package com.example.shop.config;

/**
 * @projectName: travel
 * @package: com.example.travel.config
 * @className: SwaggerConfig
 * @author: Liqian
 * @description: TODO
 * @date: 2024/4/14 22:29
 * @version: 1.0
 */


//import io.swagger.v3.oas.models.ExternalDocumentation;
//import io.swagger.v3.oas.models.OpenAPI;
//import io.swagger.v3.oas.models.info.Info;
//import io.swagger.v3.oas.models.info.License;
import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;

import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
@Configuration
public class SwaggerConfig {

    @Bean
    public OpenAPI springShopOpenAPI() {
        return new OpenAPI()
                .info(new Info().title("校园二手交易平台")
                        .description("校园二手交易平台API文档")
                        .version("v1")
                        .license(new License().name("Apache 2.0").url("http://springdoc.org")))
                .externalDocs(new ExternalDocumentation()
                        .description("外部文档")
                        .url("https://springshop.wiki.github.org/docs"));
    }

}
//@Configuration
//public class Knife4jConfig {
//    @Bean
//    public GroupedOpenApi adminApi() {      // 创建了一个api接口的分组
//        return GroupedOpenApi.builder()
//                .group("travel-api")         // 分组名称
//                .packagesToScan("com.example.travel.controller")
//                .build();
//    }
//
//
//    @Bean
//    public OpenAPI openAPI(){
//        return new OpenAPI()
//                .info(new Info()
//                        .title("Knife4j标题")
//                        .description("Knife4j说明")
//                        .version("v1")
//
//                        .license(new License().name("Apache 2.0").url("http://springdoc.org"))
//                );
//
//    }
//}
//
